2 C++ no sirve para trabajar con tildes. Que mierda!
12 const string minu
= "áéíóúñ";
13 const string mayu
= "ÁÉÍÓÚÑ";
14 const string tildes
= "áéíóúñÁÉÍÓÚÑ";
15 const string bad
= " ¡!,.:;¿?-";
17 wchar_t toLower(wchar_t c
){
19 if (bad
.find(c
) != string::npos
) return c
;
20 if ((t
= minu
.find(c
)) != string::npos
){
23 if ((t
= mayu
.find(c
)) != string::npos
){
29 bool isAlpha(wchar_t c
){
30 if (bad
.find(c
) != string::npos
) return false;
32 if (minu
.find(c
) != string::npos
) return true;
36 void clean(string
&s
){
40 for (int i
=0; i
<n
; ++i
){
42 if (bad
.find(s
[i
]) != string::npos
|| (!isAlpha(s
[i
]) && tildes
.find(s
[i
]) == string::npos
)){
48 if (tolower(s
[s
.size()-1]) == 's'){
49 s
.erase(s
.size()-1, 1);
56 while (getline(cin
, sufijos
)){
62 while (getline(cin
, line
)){
64 if (line
== "") break;